#include "tabla_simbolos.h"

Tabla_Simbolos::Tabla_Simbolos()
{
}

bool Tabla_Simbolos::additem(Item_ts *item)
{
    this->table_ts.push_back(item);

    return true;
}

Item_ts *Tabla_Simbolos::get(string id)
{
    for(int i=0;i<(int)this->table_ts.size();i++){
            if(this->table_ts.at(i)->getId().compare(id)==0){
                return this->table_ts.at(i);
            }
        }
        return 0;
}

vector<Item_ts *> Tabla_Simbolos::getALL(string id)
{
    vector<Item_ts*> temp;
        for(int i=0;i<(int)this->table_ts.size();i++){
            if(this->table_ts.at(i)->getId().compare(id)==0){
                temp.push_back( this->table_ts.at(i));
            }
        }
        return temp;
}

vector<Item_ts *> Tabla_Simbolos::getTable()
{
    return this->table_ts;
}
